package com.king.freefish.task;

import com.king.freefish.online.service.OnlineUserService;
import lombok.AllArgsConstructor;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @packageName com.king.freefish.task
 * @author: jinguoguang
 * @date: 2025/7/29 15:35
 * @description:
 **/
@Component
@AllArgsConstructor
public class CleanExpiredSessionsTask {

    private final OnlineUserService onlineUserService;

    /**
     * 每分钟执行一次，清理过期会话
     */
    @Scheduled(fixedRate = 60 * 1000)
    public void cleanExpiredSessions() {
        onlineUserService.cleanExpiredSessions();
    }
}
